SPM: Deprecate boot info struct
authorAntonio Nino Diaz <[email protected]>
Tue, 30 Oct 2018 11:52:45 +0000 (11:52 +0000)
committerAntonio Nino Diaz <[email protected]>
Mon, 10 Dec 2018 16:37:46 +0000 (16:37 +0000)
This information is defined by the Secure Partition in the resource
description.

Change-Id: Ia7db90c5de8360a596106880d3f6a632a88d3ea8
Signed-off-by: Antonio Nino Diaz <[email protected]>
include/services/secure_partition.h
plat/arm/board/fvp/fvp_common.c
services/std_svc/spm/sp_setup.c

index d565e0c57ebbd7dc4654205ff15be6feb160ace6..0ae6cf9919c16dc9424be016b8fd1776f8f57e0d 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef SECURE_PARTITION_H
 #define SECURE_PARTITION_H
 
+#if SPM_DEPRECATED
+
 #include <stdint.h>
 #include <utils_def.h>
 
@@ -46,4 +48,6 @@ typedef struct secure_partition_boot_info {
        secure_partition_mp_info_t      *mp_info;
 } secure_partition_boot_info_t;
 
+#endif /* SPM_DEPRECATED */
+
 #endif /* SECURE_PARTITION_H */
index 0edf6ba0982ad1885e193882e147a06e6fef416f..4ef86675f8c5180815b85447fadae79c05ddf6ec 100644 (file)
@@ -184,7 +184,7 @@ static unsigned int get_interconnect_master(void)
 }
 #endif
 
-#if ENABLE_SPM && defined(IMAGE_BL31)
+#if ENABLE_SPM && defined(IMAGE_BL31) && SPM_DEPRECATED
 /*
  * Boot information passed to a secure partition during initialisation. Linear
  * indices in MP information will be filled at runtime.
index 0d61306faf663cea387fadea82c28a911c8f7c18..04eedff48db7c640fe9cace4398505f277f1d970 100644 (file)
@@ -176,72 +176,4 @@ void spm_sp_setup(sp_context_t *sp_ctx)
         */
        write_ctx_reg(get_sysregs_ctx(ctx), CTX_CPACR_EL1,
                        CPACR_EL1_FPEN(CPACR_EL1_FP_TRAP_NONE));
-
-       /*
-        * Prepare information in buffer shared between EL3 and S-EL0
-        * ----------------------------------------------------------
-        */
-
-       void *shared_buf_ptr = (void *) PLAT_SPM_BUF_BASE;
-
-       /* Copy the boot information into the shared buffer with the SP. */
-       assert((uintptr_t)shared_buf_ptr + sizeof(secure_partition_boot_info_t)
-              <= (PLAT_SPM_BUF_BASE + PLAT_SPM_BUF_SIZE));
-
-       assert(PLAT_SPM_BUF_BASE <= (UINTPTR_MAX - PLAT_SPM_BUF_SIZE + 1));
-
-       const secure_partition_boot_info_t *sp_boot_info =
-                       plat_get_secure_partition_boot_info(NULL);
-
-       assert(sp_boot_info != NULL);
-
-       memcpy((void *) shared_buf_ptr, (const void *) sp_boot_info,
-              sizeof(secure_partition_boot_info_t));
-
-       /* Pointer to the MP information from the platform port. */
-       secure_partition_mp_info_t *sp_mp_info =
-               ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info;
-
-       assert(sp_mp_info != NULL);
-
-       /*
-        * Point the shared buffer MP information pointer to where the info will
-        * be populated, just after the boot info.
-        */
-       ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info =
-               (secure_partition_mp_info_t *) ((uintptr_t)shared_buf_ptr
-                               + sizeof(secure_partition_boot_info_t));
-
-       /*
-        * Update the shared buffer pointer to where the MP information for the
-        * payload will be populated
-        */
-       shared_buf_ptr = ((secure_partition_boot_info_t *) shared_buf_ptr)->mp_info;
-
-       /*
-        * Copy the cpu information into the shared buffer area after the boot
-        * information.
-        */
-       assert(sp_boot_info->num_cpus <= PLATFORM_CORE_COUNT);
-
-       assert((uintptr_t)shared_buf_ptr
-              <= (PLAT_SPM_BUF_BASE + PLAT_SPM_BUF_SIZE -
-                      (sp_boot_info->num_cpus * sizeof(*sp_mp_info))));
-
-       memcpy(shared_buf_ptr, (const void *) sp_mp_info,
-               sp_boot_info->num_cpus * sizeof(*sp_mp_info));
-
-       /*
-        * Calculate the linear indices of cores in boot information for the
-        * secure partition and flag the primary CPU
-        */
-       sp_mp_info = (secure_partition_mp_info_t *) shared_buf_ptr;
-
-       for (unsigned int index = 0; index < sp_boot_info->num_cpus; index++) {
-               u_register_t mpidr = sp_mp_info[index].mpidr;
-
-               sp_mp_info[index].linear_id = plat_core_pos_by_mpidr(mpidr);
-               if (plat_my_core_pos() == sp_mp_info[index].linear_id)
-                       sp_mp_info[index].flags |= MP_INFO_FLAG_PRIMARY_CPU;
-       }
 }